//
//  UIView+NavigationController.m
//  BaiTuan
//
//  Created by huiwenjiaoyu on 16/1/2.
//  Copyright © 2016年 YR. All rights reserved.
//

#import "UIView+NavigationController.h"

@implementation UIView (NavigationController)

- (UINavigationController *)navigationController
{
    UIResponder *nextResponder = self.nextResponder;
    while (nextResponder != nil) {
        
        if ([nextResponder isKindOfClass:[UINavigationController class]]) {
            return (UINavigationController *)nextResponder;
        }
        nextResponder = nextResponder.nextResponder;
    }
    return nil;
}

@end
